﻿package com.ease.platform.model.type
{
	import com.ease.common.enums.OptionalEnum;
	import com.ease.lang.Enum;
	import com.ease.lang.EnumConstants;
	import com.ease.platform.model.type.ConstraintType;

	[Bindable]
	[RemoteClass(alias="com.ease.platform.model.type.ConstraintType")]

	public class ConstraintType extends Enum
	{
		/* static init */
		{ initEnum(ConstraintType); }

		/* Constants */
		public static const Location:ConstraintType = new ConstraintType("Location", 1, "Location");
		public static const EntityType:ConstraintType = new ConstraintType("EntityType", 2, "EntityType");
		public static const AttributeType:ConstraintType = new ConstraintType("AttributeType", 3, "AttributeType");
		public static const Instance:ConstraintType = new ConstraintType("Instance", 4, "Instance");

		private var _value:int;
		private var _text:String;

		/*public*/ function ConstraintType(name:String=null ,value:int=0 ,text:String=null) {
			super.name = name;
			this._value = value;
			this._text = text;
		}

		public function get value():int  { return this._value; }
		public function get text():String  { return this._text; }

		/* constant query */
		public static function getEnumConstants():Array {
			return Enum.getEnumConstants(ConstraintType);
		}

		public static function get(constantName:String, caseSensitive:Boolean = false):ConstraintType {
			return ConstraintType(Enum.get(ConstraintType, constantName, caseSensitive));
		}
	}
}